CREATE TABLE [dbo].[TOUR]
(
[MA_TOUR] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TEN_TOUR] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DD_TAPTRUNG] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NOI_KH] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SO_NGAY] [smallint] NOT NULL,
[SO_CHO_CON_NHAN] [int] NOT NULL,
[NGAY_DI] [datetime] NOT NULL,
[NGAY_VE] [datetime] NOT NULL,
[GIA] [int] NOT NULL,
[TRANG_THAI] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [CHK_TOUR] CHECK ((datediff(day,[NGAY_DI],[NGAY_VE])>(0)))
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [CK__TOUR__GIA__1FCDBCEB] CHECK (([GIA]>=(0)))
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [CK__TOUR__SO_CHO_CON__1ED998B2] CHECK (([SO_CHO_CON_NHAN]>=(0)))
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [CK__TOUR__SO_NGAY__1DE57479] CHECK (([SO_NGAY]>(0)))
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [CK__TOUR__TRANG_THAI__20C1E124] CHECK (([TRANG_THAI]='DONG' OR [TRANG_THAI]='MO'))
GO
ALTER TABLE [dbo].[TOUR] ADD CONSTRAINT [PK__TOUR__A136D8E9BE9CDE46] PRIMARY KEY CLUSTERED  ([MA_TOUR]) ON [PRIMARY]
GO
